﻿#建议保存编码为：bom头 + utf8

if (Test-Path -LiteralPath "${PSScriptRoot}/_cds3_bak.json")
{
	Remove-Item "${PSScriptRoot}/_cds3_bak.json"
}

if (Test-Path -LiteralPath "${PSScriptRoot}/_cds2_bak.json")
{
	Move-Item -LiteralPath "${PSScriptRoot}/_cds2_bak.json" -Destination "${PSScriptRoot}/_cds3_bak.json"
}

if (Test-Path -LiteralPath "${PSScriptRoot}/_cds1_bak.json")
{
	Move-Item -LiteralPath "${PSScriptRoot}/_cds1_bak.json" -Destination "${PSScriptRoot}/_cds2_bak.json"
}

if (Test-Path -LiteralPath "${PSScriptRoot}/cds.json")
{
	Copy-Item -LiteralPath "${PSScriptRoot}/cds.json" -Destination "${PSScriptRoot}/_cds1_bak.json"
}

& "${PSScriptRoot}/Write-Host2.ps1"  -ForegroundColor Green '信息：备份cluster成功'
exit 0
